import { createStore, applyMiddleware,compose } from 'redux';
import createSagaMiddleware from 'redux-saga';
import mySaga from './saga';
import reducer from './reducer'

const sagaMiddleware = createSagaMiddleware();
const composeEnchancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):compose
const enchancer = composeEnchancers(applyMiddleware(sagaMiddleware));

const store = createStore(reducer,enchancer);
// sagaMiddleware.run(mySaga);
sagaMiddleware.run(mySaga)

export default store
